package common.action;

import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.Action;

public class AuthenticationAction {
    private String username;
    private String password;
    public String login () {
        @SuppressWarnings("unchecked")
        Map<String, Object> session = ServletActionContext.getContext().getSession();
        session.put("user", "aaa");
        return Action.SUCCESS;
    }
    public String logout () {
        @SuppressWarnings("unchecked")
        Map<String, Object> session = ServletActionContext.getContext().getSession();
        session.remove("user");
        return Action.SUCCESS;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getUsername() {
        return username;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getPassword() {
        return password;
    }
}
